#pragma once
#include <vector>
#include <list>
#include <deque>
using namespace std;
namespace simulation
{
	template<class T, class Container = deque<T> >
	class stack
	{
	public:
		void push(const T& val)
		{
			_con.push_back(val);
		}
		void pop()
		{
			_con.pop_back();
		}
		T& top()
		{
			return _con.back();
		}
		const T& top() const
		{
			return _con.back();
		}
		bool empty() const
		{
			return _con.empty();
		}
		size_t size() const
		{
			return _con.size();
		}
	private:
		Container _con;
	};
	void test_stack()
	{
		stack<int> mystack;
		mystack.push(5);
		mystack.push(4);
		mystack.push(3);
		mystack.push(2);
		mystack.push(1);
		cout << "mystack.size(): " << mystack.size() << endl;
		cout << "mystack.empty(): " << mystack.empty() << endl;

		while (!mystack.empty())
		{
			cout << mystack.top() << ' ';
			mystack.pop();
		}
		cout << endl;
	}
};